<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>

                //9、去除数组1[1,2,3,4,5]与数组2[1,3,5,7,9]中共同的元素
    let qwe = [1, 2, 3, 4, 5];
    let qwe1 = [1, 3, 5, 7, 9];

    for (let i = 0; i < qwe.length; i++) {
        let index = qwe1.indexOf(qwe[i]);

        if (index != -1) {
            qwe.splice(i, 1);
            qwe1.splice(index, 1);

        }

    }
    console.log(qwe);
    console.log(qwe1);
</script>

</html>